package com.mgfireworks.mgplatform.mgadmin.user;

import com.mgfireworks.mgplatform.BaseController;
import com.mgfireworks.mgplatform.mgadmin.sys.model.Organization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 代理商管理
 */
@Controller
@RequestMapping("/user/agent")
public class AgentController extends BaseController{

	@Autowired
	AgentService agentService;

	/**
	 * 下级代理商列表
	 * @return
	 */
	@GetMapping("/subAgents")
	public List<Organization> subAgents(){
		return agentService.getSubAgents(getCurrentUser());
	}
}